package com.lst.api.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: Frank
 * @date: 2019/12/30 14:33
 * @version: V1.0
 */
public enum OrderStatusEnum {

    ORDER_SUBMITTED(10, "订单已提交"),
    LOAN_APPLYING(20, "贷款申请中"),
	LOAN_SUCCESS(30, "贷款成功"),
	LOAN_FAIL(40, "贷款失败");
	

    OrderStatusEnum(Integer key, String value){
        this.key = key;
        this.value = value;
    }

    private Integer key;
    private String value;

    private static final Map<Integer, OrderStatusEnum> KEY_MAP = new HashMap<>();

    static{
        for (OrderStatusEnum item : OrderStatusEnum.values()) {
            KEY_MAP.put(item.getKey(), item);
        }
    }

    public Integer getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static OrderStatusEnum getByKey(Integer key) {
        return KEY_MAP.get(key);
    }
}
